package com.retrocc.coco.service.impl;

import com.retrocc.coco.mapper.UserMapper;
import com.retrocc.coco.entity.AdminUser;
import com.retrocc.coco.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;

@Service
public class UserServiceImpl implements UserService {
@Autowired
UserMapper userMapper;

@Override
public boolean userExits(String username, String password) {
	String md5pwd = DigestUtils.md5DigestAsHex(password.getBytes());
	AdminUser user = userMapper.userExits(username, md5pwd);
	if (user != null) {
		return true;
	}
	return false;
}
}
